using System;
using System.Collections.Generic;

namespace AtletIS.DomainModel.Entities.Main
{
    public partial class DisciplineList : EntityBase
    {
        private const string ICON_PATH = "../Resources/Icons/Disciplines/c{0:00}.png";
        
        public DisciplineList()
        {
            this.ExtTexts = new List<ExtText>();
            this.CheckPoints = new List<CheckPoint>();
            this.Performances = new List<Performance>();
        }

        public int ID { get; set; }
        public string Name { get; set; }
        public string Description { get; set; }
        public Nullable<int> ExternalId { get; set; }
        public Nullable<int> ParentId { get; set; }
        public Nullable<int> CompetitionId { get; set; }
        public Nullable<int> DisciplineId { get; set; }
        public Nullable<int> CategoryId { get; set; }
        public Nullable<int> Day { get; set; }
        public string OfficialStartTime { get; set; }
        public string StartTime { get; set; }
        public Nullable<int> Status { get; set; }
        public Nullable<int> DisciplineCode { get; set; }
        public string Note { get; set; }
        public Nullable<int> InnerCount { get; set; }
        public Nullable<int> MeasurementId { get; set; }
        public bool Relay { get; set; }
        public Nullable<int> ActivePerformanceId { get; set; }
        public string ActivePerformanceHeader { get; set; }
        public bool Active { get; set; }
        public bool Sync { get; set; }
        public Nullable<int> WebId { get; set; }
        public Nullable<System.DateTime> Modified { get; set; }

        public Category Category { get; set; }
        public Competition Competition { get; set; }
        public Discipline Discipline { get; set; }
        public DisciplinesStatus DisciplinesStatus { get; set; }

        public ICollection<ExtText> ExtTexts { get; set; }
        public ICollection<CheckPoint> CheckPoints { get; set; }
        public ICollection<Performance> Performances { get; set; }

        public ICollection<DisciplineList> SubDisciplineList { get; set; }

        public string DisciplineListInfo
        {
            get
            {
                return this.Competition.DateFrom.Value.AddDays(this.Day.Value - 1).ToString("dd.MM.yyyy") + " - " + this.OfficialStartTime;
            }
        }

        public string DisciplineListIcon
        {
            get
            {
                return string.Format(ICON_PATH, this.DisciplineCode);
            }
        }
    }
}
